﻿@page "{id:int?}"
@model ViewModel
@{
    Layout = "_MainLayout";
    dynamic dict = Locale.GetDictionary("Scada.Web.Pages.View");
    ViewBag.Title = dict.PageTitle;
}

@section Styles {
    <link href="~/css/pages/view.min.css" rel="stylesheet" asp-append-version="true" />
}

@section Scripts {
    <script src="~/js/view-hub.js" asp-append-version="true"></script>
    <script src="~/js/components/splitter.js" asp-append-version="true"></script>
    <script src="~/js/pages/view.js" asp-append-version="true"></script>
    <script>
        viewPage.pageIsEmpty = @Model.ViewError.ToLowerString();
        viewPage.initialViewID = @Model.ViewID;
        viewPage.initialViewFrameUrl = "@Model.ViewFrameUrl";
    </script>
}

@if (Model.ViewError)
{
    <div id="divError" class="box-center fs-2 text-danger">
        @Model.ErrorMessage
    </div>
}
else
{
    <div id="divView"><iframe id="frameView"></iframe></div>
    <div id="divViewSplitter" class="splitter hor"></div>
    <div id="divDataWindow"><iframe id="frameDataWindow"></iframe></div>
    <div id="divBottomPanel">@Model.RenderBottomTabs()<div id="divHideDataWindowBtn" class="bottom-pnl-btn" title="@dict.divHideDataWindowBtn_ToolTip"><i class="fas fa-chevron-circle-down"></i></div></div>
}
